Repository navigation
fix(fold): report a timed-out pose dispatch as possibly applied, and end lit-panel reads at their deadline - #5031
Conversation
The fold helper's set mode can finish sending the pose after its exec deadline, so a timeout no longer reads as an unsent pose. It now refuses with fold-hid-dispatch-timed-out and dispatched: unknown, and the hint says to check the pose and what a retry sends. A helper that exits with a failure keeps fold-hid-dispatch-failed.
The last lit-panel read after a named pose got at least 500 ms, so a read that started at the deadline could run past it. The poll now starts its last read at the latest 500 ms before the deadline, and each read's timeout is the time left until that deadline, so every read's timeout ends at the deadline that ADR 0025 and the config describe. A read that starts late, after the deadline, gets 1 ms, because a zero exec timeout means no timeout.
|
Thanks for the careful fix. The PR is ready at 311303b, and no code changes are needed. No conflicts. Only Not blocking, and fine to take or leave: the Android posture route ( Not verified here: any test run, since the tests-fail-on-base claims rest on reading the earlier code; the iPhone Duo live run output, screenshots and commit 20f18fcd1; the timeout branches of the dispatch and last panel read on a real simulator, which need fault injection; whether a keyframe retry replays from the first keyframe, because the Swift fold helper was not read; and whether a |
An emulator console that answers the posture command late may still apply it, so the adb timeout no longer surfaces as a plain adb failure. fold now refuses with fold-posture-dispatch-timed-out and dispatched: unknown, and the hint says how to check the pose and that a retry sends the posture again. A failed adb exit and a cancelled request keep their own errors.
A named pose and a keyframe trajectory now each get the retry hint that applies to them: a named pose is sent again and read back, and keyframes replay from the first one. The timeout test covers both.
|
|
Thanks for the update. The code at 97e2bc2 looks good, and the concerns from the earlier review (#5031 (comment)) are now fixed. All 15 checks pass at this commit, and nothing remains to change before merge. Not verified here: the timeout branches (a late Android console answer, a helper set that outlives its deadline) were not run on a device, since they need fault injection. The non-timeout paths are unchanged in this delta, and the live runs in the PR exercise them. The Swift fold helper was not read, so the keyframe-retry hint relies on the payload carrying the whole keyframe array. A custom Android adb provider that returns a failed result instead of throwing on its own timeout would not carry |
Summary
Follow-up to #5012 and #5019.
setreportedfold-hid-dispatch-failed("Unable to send"), although the hinge can still move after the deadline.foldalready carrieddispatched: unknown; it now also getsfold-hid-dispatch-timed-out, a "may have applied" message, and a hint saying what a retry sends (the named pose again, or the keyframes from the first). A helper exit failure is unchanged.posturewas a plain adb timeout. It now reportsfold-posture-dispatch-timed-outthe same way.screenis omitted. The fold budget is unchanged.Before / after
From the Apple and Android fold unit tests:
Validation
check:affected --run --head 97e2bc2b6,exactCommit: true: format, lint, typecheck, layering, fallow, build, and vitest-related pass.97e2bc2b6: foldable unit tests 162/162,ios-fold.test.ts7/7. The new cases fail on base.97e2bc2b6, each fold followed byscreenshot; the scoped run went throughsimctl --set:Every screenshot matched the reported panel, and a Settings tap after
fold openworked in both sets.